package ccpc_2023;

import java.util.Scanner;

public class A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        if(n == 1) {
            System.out.println(1);
            return;
        }
        long ans = 1+k;
        for(int i=1;i<=k;i++) {
            if(Math.sqrt(n)%1 == 0)  ans++;
            else if((int)Math.sqrt(n) != 1) ans+=k-i+1;
            else ans++;
            n = (int)Math.sqrt(n);
            if(n == 1)  break;
        }
        System.out.println(ans);
    }
}
